import { Field, Int, ObjectType } from "@nestjs/graphql";
import { BaseEntity } from "../base.entity/base.entity";
import { TaskItem } from "@prisma/client";
import { TaskEntity } from "../task.entity/task.entity";
import { UserTaskItemEntity } from "../user.task.item.entity/user.task.item.entity";

@ObjectType()
export class TaskItemEntity extends BaseEntity implements TaskItem {
    @Field(() => [UserTaskItemEntity], { nullable: true })
    UserTaskItem?: UserTaskItemEntity

    @Field(() => TaskEntity, { nullable: true })
    task?: TaskEntity

    @Field(() => Int)
    taskId: number

    @Field()
    name: string

    @Field({ nullable: true })
    comment: string
}
